package components.editbar
{
	import capricornus.components.window.Window;
	
	import fl.controls.CheckBox;
	import fl.controls.NumericStepper;
	import fl.controls.RadioButton;
	import fl.controls.RadioButtonGroup;
	import fl.controls.Slider;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.InteractiveObject;
	import flash.text.TextField;
	
	public class EditBarView extends Window
	{
		public var back:DisplayObject;
		public var group:RadioButtonGroup;
		public var vecRadioButton:Vector.<RadioButton>;
		public var srScale:Slider;
		public var nsPen:NumericStepper;
		public var cbPenType:CheckBox;
		public var txtRate:TextField;
		
		public var srLine:Slider;
		public var srGrid:Slider;
		public var btnSelect:InteractiveObject;
		
		public var txtX:TextField;
		public var txtY:TextField;
		public var txtI:TextField;
		public var txtJ:TextField;
		
		public var cbGrid:CheckBox;
		public var cbItem:CheckBox;
		
		public function EditBarView(owner:DisplayObjectContainer)
		{
			super(owner);
			init();
		}
		
		private function init():void
		{
			panel = new EditBarPanel();
			
			back = panel.getChildByName("back");
			srScale = panel.getChildByName("srscale") as Slider;
			srLine = panel.getChildByName("srline") as Slider;
			srGrid = panel.getChildByName("srgrid") as Slider;
			txtRate = panel.getChildByName("txtrate") as TextField;
			nsPen = panel.getChildByName("nspen") as NumericStepper;
			cbPenType = panel.getChildByName("cbPenType") as CheckBox;
			
			cbGrid = panel.getChildByName("cbgrid") as CheckBox;
			cbItem = panel.getChildByName("cbitem") as CheckBox;
			
			txtX = panel.getChildByName("txtx") as TextField;
			txtY = panel.getChildByName("txty") as TextField;
			txtI = panel.getChildByName("txti") as TextField;
			txtJ = panel.getChildByName("txtj") as TextField;
			
			btnSelect = panel.getChildByName("btnselect") as InteractiveObject;
			
			vecRadioButton = new Vector.<RadioButton>();
			var i:int = 0;
			while( true )
			{
				var rb:RadioButton = panel.getChildByName("rb"+i) as RadioButton;
				i++;
				if( rb==null ) break;
				group = rb.group;
				vecRadioButton.push( rb );
			}
		}
	}
}
